<template>
	<view>
		<!-- 封装一个铺满整个屏幕的视频组件 -->
		<video :style="videoHeight" loop objectFit="fill" class="show-video" :src="videoSrc"></video>
	</view>
</template>

<script>
	export default {
		name:"myVideo",
		data() {
			return {
				videoHeight:'height:400px'
			};
		},
		//接收父组件传来的数据
		props:{
			videoSrc:{
				type:String,
				default:''
			}
		},
		created() {
			this.getWindowHeight()
		},
		methods: {
			getWindowHeight(){
				let sysInfo = uni.getSystemInfoSync()
				console.log(sysInfo);
				this.videoHeight = 'height:'+sysInfo.windowHeight+'px'
			}
		}
	}
</script>
	
<style>
	.show-video{
		width: 100%;
	}
</style>
